<template>
  <div>
    <h2>父组件</h2>
    自己的消息：{{ msg }} <br>
    子组件给的消息：{{ childMsg }}<br>

    <el-button type="primary" @click="handleChange">切换消息</el-button>
    <br />
    <hr />
    <br />

    <Child :msg="msg" :getChildMsg="getChildMsg" />
  </div>
</template>
<script setup lang="ts">
import Child from '@views/communication/01_props/Child.vue'

const msg = ref('父组件的消息')

const handleChange = () => {
  msg.value += '~'
}

const childMsg = ref('')
const getChildMsg = (val:string)=>{
  childMsg.value = val
}
</script>

<style scoped></style>
